﻿
<Page x:Class="SkyShell.ShareContent"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
      xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.wpf4"
      xmlns:skyba="clr-namespace:SkyShell"

      
      mc:Ignorable="d" 
      d:DesignHeight="427" d:DesignWidth="540"
	Title="ShareContent" DataContext="{Binding Source={StaticResource Locator}, Path=ShareContent}" Loaded="Page_Loaded">
    <Grid ShowGridLines="False" >	
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition />
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid Grid.Row="1" Margin="0,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
        </Grid>
        <!--<TextBox Grid.Row="2" Margin="10,5" Height="23" HorizontalAlignment="Stretch" Name="textBoxDummy" VerticalAlignment="Top" IsReadOnly="True" FontSize="12" Visibility="Hidden"/>-->
        <skyba:BusyAnimation Grid.Row="0" OffsetSeconds="0.0" Margin="-5,-40,10,0" Visibility="{Binding Path=IsBusy, Converter={StaticResource VisibilityConverter}}"/>
        <skyba:BusyAnimation Grid.Row="0" OffsetSeconds="0.2" Margin="-5,-40,10,0" Visibility="{Binding Path=IsBusy, Converter={StaticResource VisibilityConverter}}"/>
        <skyba:BusyAnimation Grid.Row="0" OffsetSeconds="0.4" Margin="-5,-40,10,0" Visibility="{Binding Path=IsBusy, Converter={StaticResource VisibilityConverter}}"/>
        <skyba:BusyAnimation Grid.Row="0" OffsetSeconds="0.6" Margin="-5,-40,10,0" Visibility="{Binding Path=IsBusy, Converter={StaticResource VisibilityConverter}}"/>
        <skyba:BusyAnimation Grid.Row="0" OffsetSeconds="0.8" Margin="-5,-40,10,0" Visibility="{Binding Path=IsBusy, Converter={StaticResource VisibilityConverter}}"/>
        <TabControl Grid.Row="3" Name="tabControl1" TabStripPlacement="Left">
        
            <TabItem Header="Send email" Name="tabItem2" FontSize="16">
                <Grid Margin="8,0,0,0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="140" />
                        <RowDefinition Height="128*" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <TextBlock HorizontalAlignment="Stretch" Margin="0" Name="textBlock1" Text="{Binding Path=FolderName, Mode=OneWay, StringFormat=Send a link to \&quot;\{0\}\&quot; in email}" VerticalAlignment="Center" FontSize="22" Foreground="#FF656565" TextWrapping="WrapWithOverflow" />
                    <TextBlock Grid.Row="1" HorizontalAlignment="Left" Margin="0,8,4,0" Name="textBlock2" Text="To:" VerticalAlignment="Top" FontSize="16" />
                    <TextBox Grid.Row="2" Name="textBox1" VerticalAlignment="Center" FontSize="16" Text="{Binding Path=MailTo, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                    <TextBlock FontSize="16" HorizontalAlignment="Left" Name="textBlock3" Text="Include a personal message" VerticalAlignment="Center" Grid.Row="3" Margin="0,8,0,4" />
                    <TextBox Grid.Row="4" HorizontalAlignment="Stretch" Name="textBox2" VerticalAlignment="Stretch" Text="{Binding Path=PersonalMessage, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                    <Button Content="Share" Grid.Row="6" Height="30" HorizontalAlignment="Right" Margin="0,0,120,8" Name="button1" VerticalAlignment="Top" Width="100" Background="#FF094AB2" BorderBrush="#FF094AB2" Foreground="White" FontSize="16" Command="{Binding Path=ShareByEmail}" />
                    <Button Content="Cancel" Grid.Row="6" Height="30" HorizontalAlignment="Right" Margin="0,0,8,8" Name="button4" VerticalAlignment="Top" Width="100" FontSize="16" Command="{Binding Path=Done}" />
                    <CheckBox Content="Allow user to edit" Grid.Row="5" HorizontalAlignment="Left" Margin="0,8,0,0" Name="checkBox1" VerticalAlignment="Top" IsChecked="{Binding Path=EmailEditableShare, Mode=TwoWay}" Padding="10,-3,0,0" />
                </Grid>
            </TabItem>
            <TabItem Header="Get a link" Name="tabItem1" FontSize="16">
                <Grid Margin="10,0,0,0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="99*" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <TextBlock FontSize="22" Foreground="#FF656565" HorizontalAlignment="Stretch" Margin="0" Name="textBlock4" Text="{Binding Path=FolderName, Mode=OneWay, StringFormat=Get a link to \&quot;\{0\}\&quot;}" TextWrapping="WrapWithOverflow" VerticalAlignment="Center" Grid.Row="0" />
                    <TextBlock Grid.Row="1" HorizontalAlignment="Left" Margin="0,40,0,0" Name="textBlock5" Text="View only" VerticalAlignment="Center" FontSize="16" />
                    <TextBlock HorizontalAlignment="Stretch" Margin="0" Name="textBlock6" Text="Anyone with this link can see the files you share" VerticalAlignment="Center" Grid.Row="2" Foreground="#FF8E8E8E" FontSize="14" />
                    <StackPanel Grid.Row="4" Orientation="Horizontal" Margin="0,4">
                        <Button Content="Create"  HorizontalAlignment="Left" Margin="0" Name="button2" VerticalAlignment="Top" Width="100" FontSize="16" Command="{Binding Path=CreateReadonlyLink}" Visibility="{Binding Path=ReadonlySharedLink, Converter={StaticResource IsNullVisibilityConverter}, ConverterParameter=negate}" />
                        <Button Content="Copy to clipboard"  HorizontalAlignment="Left" Margin="0" VerticalAlignment="Top" Width="150" FontSize="16" Command="{Binding Path=CopyToClipboard}" Visibility="{Binding Path=ReadonlySharedLink, Converter={StaticResource IsNullVisibilityConverter}}" CommandParameter="readonly" />
                    </StackPanel>
                    <TextBox Grid.Row="3" Name="textBoxReadonlyLink" Visibility="{Binding Path=ReadonlySharedLink, Converter={StaticResource IsNullVisibilityConverter}}" Text="{Binding Path=ReadonlySharedLink}" Margin="0,4" />
                    <TextBlock HorizontalAlignment="Left" Margin="0,40,0,0" Name="textBlock7" Text="View and edit" VerticalAlignment="Top" Grid.Row="5" FontSize="16" />
                    <TextBlock HorizontalAlignment="Stretch" Margin="0" Name="textBlock8" Text="Anyone with this link can see and edit the files you share" VerticalAlignment="Center" Grid.Row="6" Foreground="#FF8E8E8E" FontSize="14" />
                    <TextBox Margin="0,4" Name="textBoxEditableLink" Grid.Row="7" VerticalAlignment="Center" Text="{Binding Path=EditableSharedLink}" Visibility="{Binding Path=EditableSharedLink, Converter={StaticResource IsNullVisibilityConverter}}" />
                    <StackPanel Grid.Row="8" Orientation="Horizontal" Margin="0,4">
                        <Button Content="Create" FontSize="16" HorizontalAlignment="Left" Margin="0" Name="button3" VerticalAlignment="Top" Width="100" Grid.Row="8" Command="{Binding Path=CreateEditableLink}" Visibility="{Binding Path=EditableSharedLink, Converter={StaticResource IsNullVisibilityConverter}, ConverterParameter=negate}" />
                        <Button Content="Copy to clipboard"  HorizontalAlignment="Left" Margin="0" VerticalAlignment="Top" Width="150" FontSize="16" Command="{Binding Path=CopyToClipboard}" Visibility="{Binding Path=EditableSharedLink, Converter={StaticResource IsNullVisibilityConverter}}" CommandParameter="editable" />
                    </StackPanel>
                    <Button Content="Done" FontSize="16" Height="30" HorizontalAlignment="Right" Margin="0,0,8,8" Name="button5" VerticalAlignment="Top" Width="100" Grid.Row="10" Command="{Binding Path=Done}" />
                </Grid>
            </TabItem>
        </TabControl>
    </Grid>
</Page>
